package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.entity.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface CartMapper extends BaseMapper<Cart> {

    int insertCart(@Param("goodId") String goodId, @Param("uId") int uId,
                   @Param("num")int num, @Param("createTime")Date createTime,
                   @Param("updateTime")Date updateTime);

    int delectCart(@Param("goodId")String goodId,@Param("uId")int uId);

    int addCart(@Param("goodId")String goodId,@Param("uId")int uId);

    int reduceCart(@Param("goodId")String goodId,@Param("uId")int uId);

    List<Map<String,Integer>> selectCart(int userId);

    int updateCart(@Param("num")int num,@Param("updateTime")Date updateTime,@Param("goodId")int goodId,@Param("userId")int userId);


}
